
#ifndef LDW_MARKING_DT_H_
#define LDW_MARKING_DT_H_

#include "data_frame.h"
#include "lane_const_parameter.h"
#include "lane_detection.h"
#include <string.h>
#include "json.h"

namespace rmd {

class RoadMarkingDetection {
 public:
    DataFrame* data_frame;

    LaneDetection*  lane_detection;

  RoadMarkingDetection();
  virtual ~RoadMarkingDetection();

  std::string GetRoadMarkDetectionVersion();

  void SetBelowSpeedStatus();
  void setVanishPoint(float x, float y,bool bflag = true);
  CALMCARLDWDATA Update(cv::Mat image);
  void Init(std::string configFilePath, int width, int height);

   Json::Value createResultJson(CALMCARLDWDATA& _vecResult,double _time);

  void setLdwParameter(short _ldwMinDis,float _ldwThreadK,
                       short update_gap = kUpdateGap,
                       short auto_frame_gap = kAutoFrameGap,
                       short stable_num = kStableNum);

  void setInputImage(cv::Mat input_image);

 private:
  std::vector<cv::Rect> mVehicleInfo;
  char config_file_path[kMaxChar];

  CALMCARLDWDATA OutputAllProcessResult(
      std::vector<LaneLine>& _inResPriSaveLine);

  void RelocationZoneByVP(int _vanishY);

  CALMCARLDWDATA CheckShowResult(CALMCARLDWDATA& _inLaneResult);

  void GetInitRoiZone(CALMCARLDWDATA& _vecResult);

  bool LimitingCondition(int x, int y, short limit_type);

  CALMCARLDWDATA mLaneResult;
  CALMCARLDWDATA output_imshow_result;
  short mLdwMinDis;
  float mLdwThreadK;

  short departure_warning;

//  float left_rho;
//  float right_rho;

  cv::Point mSelectPoints[7];
  cv::Point mLineType;
  cv::Point mLeftPoints[3];
  cv::Point mRightPoints[3];


};

} /* namespace rmd */

#endif
